package com.qingcloud.adminbackend.enums;

public enum UserTypeEnum {

    HEALTH_USER(1, "健康空气用户"),
    WAMING_USER(2, "蛙鸣用户"),
    WEATHER_USER(3, "网格化用户");

    public int code;

    public String name;

    UserTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(int code) {
        UserTypeEnum[] uss = values();
        for (UserTypeEnum us : uss) {
            if (us.code == code) {
                return us.name;
            }
        }
        return null;
    }
}
